Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to pydantic v2 and switch tests to Polyfactory #550

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

Leobouloc
Copy link
Contributor

@Leobouloc Leobouloc commented Jan 10, 2024

Purpose

Migrate to pydantic v2 for speed (as suggested: #401) and warren compatibility.

As hypothesis is no longer supported, it was decided to use polyfactory for model generation.

@Leobouloc Leobouloc added the WIP label Jan 10, 2024
Copy link
Contributor

@wilbrdt wilbrdt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alt
Huge work!

src/ralph/api/__init__.py Show resolved Hide resolved
src/ralph/api/auth/basic.py Outdated Show resolved Hide resolved
src/ralph/api/auth/basic.py Show resolved Hide resolved
src/ralph/api/auth/oidc.py Outdated Show resolved Hide resolved
src/ralph/api/auth/user.py Outdated Show resolved Hide resolved
tests/models/edx/test_enrollment.py Outdated Show resolved Hide resolved
tests/models/test_converter.py Outdated Show resolved Hide resolved
tests/models/test_validator.py Outdated Show resolved Hide resolved
tests/models/test_validator.py Show resolved Hide resolved
tests/models/xapi/base/test_statements.py Show resolved Hide resolved
Copy link
Collaborator

@SergioSim SergioSim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks amazing 👍

Can't wait to see this merged) have only a few optional minor questions)

image

.env.dist Outdated Show resolved Hide resolved
docs/CHANGELOG.md Outdated Show resolved Hide resolved
docs/commands.md Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
tests/backends/data/test_async_lrs.py Show resolved Hide resolved
src/ralph/cli.py Show resolved Hide resolved
src/ralph/conf.py Outdated Show resolved Hide resolved
src/ralph/conf.py Outdated Show resolved Hide resolved
src/ralph/conf.py Show resolved Hide resolved
src/ralph/models/xapi/base/common.py Outdated Show resolved Hide resolved
@Leobouloc Leobouloc force-pushed the structure/tests/pydantic-v2-and-polyfactory branch from 00a2614 to 90be668 Compare January 24, 2024 18:54
@Leobouloc Leobouloc added improvement and removed WIP labels Jan 24, 2024
@Leobouloc Leobouloc force-pushed the structure/tests/pydantic-v2-and-polyfactory branch 2 times, most recently from 548bcc5 to 81d37d4 Compare January 24, 2024 19:18
@wilbrdt wilbrdt force-pushed the structure/tests/pydantic-v2-and-polyfactory branch 2 times, most recently from f4c8287 to f739ca3 Compare April 12, 2024 14:44
@wilbrdt wilbrdt self-assigned this Apr 12, 2024
@wilbrdt wilbrdt requested review from quitterie-lcs and wilbrdt and removed request for wilbrdt April 12, 2024 14:45
@wilbrdt wilbrdt added this to the 5.0 milestone Apr 12, 2024
@wilbrdt wilbrdt force-pushed the structure/tests/pydantic-v2-and-polyfactory branch 2 times, most recently from e46e3b3 to de2d1d9 Compare April 16, 2024 08:24
Copy link
Contributor

@quitterie-lcs quitterie-lcs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src/ralph/api/routers/statements.py Show resolved Hide resolved
src/ralph/models/xapi/base/ifi.py Outdated Show resolved Hide resolved
src/ralph/models/xapi/base/unnested_objects.py Outdated Show resolved Hide resolved
src/ralph/models/xapi/virtual_classroom/results.py Outdated Show resolved Hide resolved
tests/api/test_statements_get.py Show resolved Hide resolved
@wilbrdt wilbrdt requested a review from quitterie-lcs April 18, 2024 07:33
@wilbrdt wilbrdt force-pushed the structure/tests/pydantic-v2-and-polyfactory branch from de2d1d9 to 8ebdca5 Compare April 18, 2024 07:34
Copy link
Contributor

@quitterie-lcs quitterie-lcs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Migrating to `pydantic` v2 should speed up processing and allow
interoperability with projects such as `warren`. This migration makes the
hypothesis package used in tests obsolete, which is why we introduce
`polyfactory`.
@wilbrdt wilbrdt force-pushed the structure/tests/pydantic-v2-and-polyfactory branch from 8ebdca5 to 2f25e8b Compare April 19, 2024 15:17
@wilbrdt wilbrdt merged commit db52c78 into main Apr 19, 2024
25 checks passed
@wilbrdt wilbrdt deleted the structure/tests/pydantic-v2-and-polyfactory branch April 19, 2024 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants